home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / gui / guienv376.lha / GUIEnvironment / OberonA / Source / 3rdParty / GUIEnv.mod < prev    next >
Encoding:
Text File  |  1994-12-18  |  21.1 KB  |  646 lines

  1. (****************************************************************************
  2.  
  3. $RCSfile: GUIEnv.mod $
  4.  
  5. $Revision: 1.8 $
  6.     $Date: 1994/12/18 15:16:03 $
  7.  
  8.     Oberon-2 interface module for GUIEnvironment
  9.  
  10.     Oberon-A Oberon-2 Compiler V4.17 (Release 1.4 Update 2)
  11.  
  12.   Copyright © 1994, Carsten Ziegeler
  13.                     Augustin-Wibbelt-Str.7, 33106 Paderborn, Germany
  14.  
  15.  
  16. ****************************************************************************)
  17. MODULE GUIEnv;
  18.  
  19. (* $P- Allow non-portable code *)
  20.  
  21.  
  22. IMPORT K := Kernel,
  23.        E := Exec,
  24.        G := Graphics,
  25.        I := Intuition,
  26.        U := Utility;
  27.  
  28.  
  29. CONST
  30.  
  31.   Name* = "guienv.library";     (* Library name *)
  32.   Version* = 37;                (* min version / Revision 2 !*)
  33.  
  34.  
  35. (* ======================================================================= *)
  36. (*                               Error codes                               *)
  37. (* ======================================================================= *)
  38.  
  39. CONST
  40.  
  41.   geDone             *=   0;   (* no error, everything done *)
  42.   geMemoryErr        *=   1;   (* not enough memory *)
  43.   geWindowErr        *=   2;   (* no window specified *)
  44.   geVisualInfoErr    *=   3;   (* couldn't get VisualInfo *)
  45.   geDrawInfoErr      *=   4;   (* couldn't get DrawInfo *)
  46.   geGuideErr         *=  50;   (* couldn't display AmigaGuide node *)
  47.  
  48.   geGadContextErr    *= 100;   (* GadTools CreateContext failed *)
  49.   geGadCreateErr     *= 101;   (* error calling CreateGadget/NewObject *)
  50.   geGadTooManyErr    *= 102;   (* more than 256 gadgets *)
  51.   geGadKeyTwiceErr   *= 103;   (* same key equivalent for two gadgets *)
  52.   geGadUnknownKind   *= 104;   (* unknown gadget kind *)
  53.   geGadChainErr      *= 105;   (* ChainStart/ChainEnd missing *)
  54.   geGadHookErr       *= 106;   (* Hook function failed *)
  55.  
  56.   geMenuCreateErr    *= 200;   (* error calling CreateMenu *)
  57.   geMenuStripErr     *= 201;   (* error calling SetMenuStrip *)
  58.   geMenuLayoutErr    *= 202;   (* error calling LayoutMenus *)
  59.   geMenuTooManyErr   *= 203;   (* more than 256 menu items *)
  60.  
  61.  
  62. (* ======================================================================= *)
  63. (*                         GE Hook functions                               *)
  64. (* ======================================================================= *)
  65.  
  66. (* The GUIEnvironment hook functions:
  67.    - The hook functions are implemented as amiga callback hooks as
  68.      documented in the Utilities documentation
  69.    - Before a hook functions is called, the A4 register is set
  70.    - The A0 register points to Hook structure
  71.    - The A1/A2 register are used as stated below
  72.  
  73. *)
  74.  
  75. (* ------------------------ return values -------------------------------- *)
  76.  
  77.   gehKeyShifted  *= 512;
  78.   gehKeyUnknown  *= -1;
  79.  
  80. (* ------------------------ The hook functions --------------------------- *)
  81.  
  82. TYPE
  83.  
  84.          (* Hook function for key equivalents:
  85.  
  86.               A1      : Currently unused, set to NIL
  87.               A2      : LONGINT : The ASCII character code
  88.               RESULT  : LONGINT : gehKeyUnknown if the key is not a key
  89.                                   equivalent or the number of the gadget,
  90.                                   or the number of the gadget plus
  91.                                   gehKeyShifted !
  92.  
  93.          *)
  94.  
  95.          (* Handle message hook
  96.  
  97.               A1, A2  : Currently unused, set to NIL
  98.               RESULT  : LONGINT, handled as BOOLEAN
  99.                         Return TRUE, if GUIEnv should not work on the
  100.                         message anymore, otherwise FALSE
  101.  
  102.  
  103.             Refresh hook
  104.  
  105.               A1, A2  : Currently unused, set to NIL
  106.               RESULT  : Currently unused, set this always to 0 !
  107.  
  108.          *)
  109.  
  110.          (* Gadget event message hook
  111.  
  112.               A2      : Pointer to event gadget
  113.               A1      : Currently unused, set to NIL
  114.               RESULT  : LONGINT, handled as BOOLEAN
  115.                         If you want to wait for further messages return
  116.                         TRUE, otherwise FALSE to exit the message-loop.
  117.  
  118.  
  119.             Menu event message hook
  120.  
  121.               A2      : Pointer to event menu item (if possible)
  122.               A1      : Currently unused, set to NIL
  123.               RESULT  : LONGINT, handled as BOOLEAN
  124.                         If you want to wait for further messages return
  125.                         TRUE, otherwise FALSE to exit the message-loop.
  126.  
  127.  
  128.             Gadget creation hook
  129.  
  130.               A2      : Pointer to event gadget
  131.               A1      : Currently unused, set to NIL
  132.               RESULT  : LONGINT, handled as BOOLEAN
  133.                         If your creation hook has done his work, return
  134.                         TRUE, otherwise FALSE to stop creation !
  135.  
  136.          *)
  137.  
  138. (* ======================================================================= *)
  139. (*                               Gadgets                                   *)
  140. (* ======================================================================= *)
  141.  
  142. CONST
  143. (* ----------------------- gadget kinds ---------------------------------- *)
  144.  
  145.   gegKinds                 *=  65535; (* GUIEnv gadgets *)
  146.   gegProgressIndicatorKind *=  65536;
  147.   gegBevelboxKind          *=  65537;
  148.   gegBorderKind            *=  65538;
  149.  
  150.   gegBOOPSIKinds           *= 131071; (* BOOPSI gadgets *)
  151.   gegBOOPSIPublicKind      *= 131072;
  152.   gegBOOPSIPrivateKind     *= 131073;
  153.  
  154. (* ----------------------- gadget chain flags ---------------------------- *)
  155.  
  156.   gegChainUpNext     *= 0;  (* 16 bits *)
  157.   gegChainUpPrev     *= 1;
  158.   gegChainDownNext   *= 2;
  159.   gegChainDownPrev   *= 3;
  160.  
  161.  
  162. (* ----------------------- gadget description flags ---------------------- *)
  163.  
  164. CONST
  165.   gegDistNorm    *=  0;  (* Normal distance *)
  166.   gegDistAbs     *=  1;  (* absolute distance from an object *)
  167.   gegDistRel     *=  2;  (* relative distance from an object *)
  168.   gegDistPercent *=  3;  (* percentual distance *)
  169.  
  170.   gegObjBorder   *=  0;  (* window border *)
  171.   gegObjGadget   *=  4;  (* gadget (standard is previous gadget) *)
  172.  
  173.   gegObjRight    *=  0;  (* distance from which part of the object *)
  174.   gegObjBottom   *=  0;
  175.   gegObjLeft     *= 32;
  176.   gegObjTop      *= 32;
  177.  
  178. (* ----------------------- gadget tag values ----------------------------- *)
  179.  
  180.   gegACTIVATIONUP  *=  0;
  181.   gegACTIVATIONDOWN*=  1;
  182.  
  183.  
  184.   gegALLGADGETS    *= -1;
  185.  
  186. (* ----------------------- gadget tags ----------------------------------- *)
  187.  
  188.   gegBase *= U.tagUser + 016000H;
  189.   gegText            *= gegBase +  1;
  190.   gegFlags           *= gegBase +  2;
  191.   gegFont            *= gegBase +  3;
  192.   gegUserData        *= gegBase +  4;
  193.   gegDescription     *= gegBase +  5;
  194.   gegObjects         *= gegBase +  6;
  195.   gegGuideNode       *= gegBase +  7;
  196.   gegCatalogString   *= gegBase + 10;
  197.   gegClass           *= gegBase + 11;
  198.   gegVarAddress      *= gegBase + 12;
  199.   gegHandleInternal  *= gegBase + 13;
  200.   gegStartChain      *= gegBase + 14;
  201.   gegEndChain        *= gegBase + 15;
  202.   gegActivate        *= gegBase + 16;
  203.   gegChainActivation *= gegBase + 17;
  204.   gegStatus          *= gegBase + 19;
  205.   gegUpAHook         *= gegBase + 20;
  206.   gegDownAHook       *= gegBase + 21;
  207.   gegCreationAHook   *= gegBase + 22;
  208.  
  209.   gegPIMaxValue      *= gegBase + 50;
  210.   gegPICurrentValue  *= gegBase + 51;
  211.   gegBBRecessed      *= gegBase + 52;
  212.  
  213.   gegDisable         *= gegBase + 100;
  214.   gegEnable          *= gegBase + 101;
  215.   gegSetVar          *= gegBase + 102;
  216.   gegGetVar          *= gegBase + 103;
  217.   gegActivateUp      *= gegBase + 104;
  218.   gegActivateDown    *= gegBase + 105;
  219.  
  220.   gegAddress         *= gegBase + 200;
  221.   gegLeftEdge        *= gegBase + 201;
  222.   gegTopEdge         *= gegBase + 202;
  223.   gegWidth           *= gegBase + 203;
  224.   gegHeight          *= gegBase + 204;
  225.   gegRedraw          *= gegBase + 205;
  226.  
  227.  
  228. (* ----------------------- GUIGadgetInfo structure ------------------------ *)
  229.  
  230. TYPE
  231.  
  232.   GUIGadgetInfoPtr *= CPOINTER TO GUIGadgetInfo; (* gadget^.userData *)
  233.  
  234.   GUIGadgetInfo *= RECORD  (* a pointer to this structure is stored in
  235.                              gadget^.userData *)
  236.     userData - : E.APTR;    (* use this for own user data *)
  237.     kind     - : LONGINT;   (* gadget kind *)
  238.  
  239.     gadgetClass - : E.APTR; (* The BOOPSI Gadget Class *)
  240.  
  241.     functionUp   - : U.HookPtr;
  242.     functionDown - : U.HookPtr;
  243.  
  244.     guideNode- : E.STRPTR;  (* The AmigaGuide node for this gadget *)
  245.  
  246.   END;
  247.  
  248.  
  249. (* ======================================================================= *)
  250. (*                             Menu Items                                  *)
  251. (* ======================================================================= *)
  252.  
  253. CONST
  254. (* ---------------------- menu item tags --------------------------------- *)
  255.  
  256.   gemBase *= U.tagUser + 018000H;
  257.   gemUserData        *= gemBase + 1;
  258.   gemGuideNode       *= gemBase + 3;
  259.   gemCatalogString   *= gemBase + 4;
  260.   gemShortCut        *= gemBase + 5;
  261.   gemFlags           *= gemBase + 6;
  262.   gemMutualExclude   *= gemBase + 7;
  263.   gemAHook           *= gemBase + 8;
  264.  
  265. (* ---------------------- GUIMenuInfo structure -------------------------- *)
  266.  
  267. TYPE
  268.  
  269.   GUIMenuInfoPtr *= CPOINTER TO GUIMenuInfo; (* menu^.userData *)
  270.  
  271.   GUIMenuInfo *= RECORD    (* a pointer to this structure is stored in
  272.                               menuitem^.userData *)
  273.     userData - : E.APTR;     (* use this for own user data *)
  274.  
  275.     function - : U.HookPtr;
  276.  
  277.     guideNode- : E.STRPTR;   (* The AmigaGuide node for this menuitem *)
  278.  
  279.   END;
  280.  
  281.  
  282.  
  283. (* ======================================================================= *)
  284. (*                            GUIInfo                                      *)
  285. (* ======================================================================= *)
  286.  
  287. (* -------------------------- GUIInfo structure -------------------------- *)
  288.  
  289.   GUIInfoPtr *= CPOINTER TO GUIInfo;
  290.   GUIInfo *= RECORD
  291.     window     - : I.WindowPtr;         (* pointer to the used Window *)
  292.     screen     - : I.ScreenPtr;         (* pointer to window's screen *)
  293.     visualInfo - : E.APTR;              (* pointer to screen's VisualInfo *)
  294.     drawInfo   - : I.DrawInfoPtr;       (* pointer to a copy of DrawInfo *)
  295.     localeInfo - : E.APTR;              (* pointer to locale environment *)
  296.  
  297.     menuFont - : G.TextAttrPtr;         (* pointer to menu-font. Is set to
  298.                                            screens font. *)
  299.  
  300.     creationWidth  - : INTEGER;       (* window inner width *)
  301.     creationHeight - : INTEGER;       (* window inner height *)
  302.  
  303.     msgPort  - : E.MsgPortPtr;        (* Pointer to IDCMP-Port *)
  304.  
  305.     intuiMsg - : I.IntuiMessagePtr;   (* Points to a copy of the
  306.                                          FULL IntuiMessage even if it
  307.                                          is extended (OS3.0+) *)
  308.  
  309.  (* Additional information about the message: *)
  310.     msgClass - : SET;
  311.  
  312.     msgCode     - : INTEGER;
  313.     msgBoolCode - : BOOLEAN;
  314.     msgCharCode - : CHAR;
  315.  
  316.     msgGadget  - : I.GadgetPtr;
  317.  
  318.     msgItemAdr - : I.MenuItemPtr;
  319.  
  320.     msgGadNbr  - : INTEGER;
  321.  
  322.     msgMenuNum - : INTEGER;
  323.     msgItemNum - : INTEGER;
  324.     msgSubNum  - : INTEGER;
  325.  
  326.  (* Some user stuff: *)
  327.     userData      - : E.APTR;         (* for own data *)
  328.     compilerReg   - : E.APTR;         (* for compiler data reg *)
  329.  
  330.     gadgetGuide   - : E.APTR;         (* name & path for the guide *)
  331.     menuGuide     - : E.APTR;         (* name & path for the guide *)
  332.  
  333.     catalogInfo   - : E.APTR;         (* points to the catalog given
  334.                                          with the GUI_CatalogFile tag *)
  335.     gadgetCatalogString - : LONGINT;  (* The number of the next string *)
  336.     menuCatalogString   - : LONGINT;  (* in the catalog *)
  337.  
  338.     vanKeyHook    - : U.HookPtr;        (* Hook functions *)
  339.     handleMsgHook - : U.HookPtr;
  340.     refreshHook   - : U.HookPtr;
  341.  
  342.     hookInterface - : E.APTR;
  343.  
  344.     creationFont  - : G.TextAttrPtr;  (* GUIDefinition: text/gadget font *)
  345.     textFont      - : G.TextAttrPtr;  (* Font for gadgets and text *)
  346.  
  347.   END;
  348.  
  349. CONST
  350.  
  351. (* --------------------------- GUI Tags ------------------------------------ *)
  352.  
  353.   guiBase *= U.tagUser + 015000H;
  354.   guiTextFont            *= guiBase +  1;
  355.   guiMenuFont            *= guiBase +  2;
  356.   guiCreateError         *= guiBase +  4;
  357.   guiUserData            *= guiBase +  5;
  358.   guiCompilerReg         *= guiBase +  6;
  359.   guiGadgetGuide         *= guiBase +  8;
  360.   guiMenuGuide           *= guiBase +  9;
  361.   guiCatalogFile         *= guiBase + 10;
  362.   guiGadgetCatalogOffset *= guiBase + 11;
  363.   guiMenuCatalogOffset   *= guiBase + 12;
  364.   guiCreationWidth       *= guiBase + 13;
  365.   guiCreationHeight      *= guiBase + 14;
  366.   guiMsgPort             *= guiBase + 16;
  367.   guiRefreshAHook        *= guiBase + 17;
  368.   guiHandleMsgAHook      *= guiBase + 18;
  369.   guiVanKeyAHook         *= guiBase + 19;
  370.   guiHookInterface       *= guiBase + 20;
  371.   guiCreationFont        *= guiBase + 21;
  372.   guiPreserveWindow      *= guiBase + 22;
  373.  
  374.   guiRemoveMenu          *= guiBase + 100;
  375.   guiRemoveGadgets       *= guiBase + 101;
  376.   guiClearWindow         *= guiBase + 102;
  377.   guiEmptyMsgPort        *= guiBase + 103;
  378.   guiDoBeep              *= guiBase + 104;
  379.   guiLock                *= guiBase + 105;  (* Requires ReqTools *)
  380.   guiUnLock              *= guiBase + 106;  (* Requires ReqTools *)
  381.  
  382.  
  383. (* -------------------- Preserve Window Flags ---------------------------- *)
  384.  
  385.   guiPWFull    *= 0;   (* Preserve the window and the min and max values *)
  386.   guiPWSize    *= 1;   (* Preserve only the window *)
  387.   guiPWMinMax  *= 2;   (* Preserve only the min and max values *)
  388.  
  389.  
  390. (* ======================================================================= *)
  391. (*                             Requester                                   *)
  392. (* ======================================================================= *)
  393.  
  394. (* -------------------- Requester kinds ---------------------------------- *)
  395.  
  396.   gerGeneralKind *= 0;
  397.   gerOKKind      *= 1;
  398.   gerDoItKind    *= 2;
  399.   gerYNCKind     *= 3;
  400.   gerFileKind    *= 4;
  401.   gerDirKind     *= 5;
  402.  
  403.   gerRTKind      *= 100;  (* Requires ReqTools *)
  404.   gerRTOKKind    *= 101;
  405.   gerRTDoItKind  *= 102;
  406.   gerRTYNCKind   *= 103;
  407.   gerRTFileKind  *= 104;
  408.   gerRTDirKind   *= 105;
  409.  
  410. (* --------------------- Return values ----------------------------------- *)
  411.  
  412.   gerCancel *= 0;  (* gerYNCKind / gerDoItKind / gerOKKind /
  413.                      gerFileKind / gerDirKind*)
  414.   gerYes    *= 1;  (* gerYNCKind / gerDoItKind / gerFileKind / gerDirKind *)
  415.   gerNo     *= 2;  (* gerYNCKind *)
  416.  
  417. (* --------------------- Requester tags ---------------------------------- *)
  418.  
  419.   gerBase *= U.tagUser + 017000H;
  420.   gerGadgets        *= gerBase +  1;
  421.   gerArgs           *= gerBase +  2;
  422.   gerFlags          *= gerBase +  3;
  423.   gerTitle          *= gerBase +  4;
  424.   gerIDCMP          *= gerBase +  5;
  425.   gerPattern        *= gerBase +  6;
  426.   gerNameBuffer     *= gerBase +  7;
  427.   gerFileBuffer     *= gerBase +  8;
  428.   gerDirBuffer      *= gerBase +  9;
  429.   gerSave           *= gerBase + 10;
  430.   gerLocaleID       *= gerBase + 11;
  431.  
  432. (* ======================================================================= *)
  433. (*                              Windows                                    *)
  434. (* ======================================================================= *)
  435.  
  436. (* ---------------------- window tags ------------------------------------ *)
  437.  
  438.   gewBase *= U.tagUser + 019000H;
  439.   gewOuterSize *= gewBase + 1;
  440.  
  441.  
  442. (* --- Library Base variable -------------------------------------------- *)
  443.  
  444. TYPE GUIEnvBase * = E.Library;
  445.      GUIEnvBasePtr * = CPOINTER TO GUIEnvBase;
  446.  
  447. VAR
  448.  
  449.   base *  : GUIEnvBasePtr;
  450.  
  451.  
  452. (* --- Library Functions ------------------------------------------------ *)
  453.  
  454.   LIBCALL (base : GUIEnvBasePtr) OpenGUIFont *
  455.           (name[8] : E.STRPTR;
  456.            size[0] : INTEGER;
  457.            font[9] : G.TextAttrPtr) : G.TextFontPtr;    -30;
  458.  
  459.   LIBCALL (base : GUIEnvBasePtr) CloseGUIFont *
  460.           (font[8] : G.TextFontPtr);            -36;
  461.  
  462.   LIBCALL (base : GUIEnvBasePtr) OpenGUIScreenA *
  463.           (id[0] : LONGINT;
  464.            depth[1]: INTEGER;
  465.            name[8] : E.STRPTR;
  466.            tags[9] : ARRAY OF U.TagItem) : I.ScreenPtr;    -42;
  467.  
  468.   LIBCALL (base : GUIEnvBasePtr) OpenGUIScreen *
  469.           (id[0] : LONGINT;
  470.            depth[1]: INTEGER;
  471.            name[8] : E.STRPTR;
  472.            tags[9].. : U.Tag) : I.ScreenPtr;    -42;
  473.  
  474.   LIBCALL (base : GUIEnvBasePtr) OpenGUIWindowA *
  475.           (left[0] : INTEGER;
  476.            top[1]  : INTEGER;
  477.            width[2]  : INTEGER;
  478.            height[3] : INTEGER;
  479.            name[8] : E.STRPTR;
  480.            idcmpFlags[4]  : SET;
  481.            windowFlags[5] : SET;
  482.            screen[9] : I.ScreenPtr;
  483.            tags[10]  : ARRAY OF U.TagItem) : I.WindowPtr;  -48;
  484.  
  485.   LIBCALL (base : GUIEnvBasePtr) OpenGUIWindow *
  486.           (left[0] : INTEGER;
  487.            top[1]  : INTEGER;
  488.            width[2]  : INTEGER;
  489.            height[3] : INTEGER;
  490.            name[8] : E.STRPTR;
  491.            idcmpFlags[4]  : SET;
  492.            windowFlags[5] : SET;
  493.            screen[9] : I.ScreenPtr;
  494.            tags[10].. : U.Tag) : I.WindowPtr;  -48;
  495.  
  496.   LIBCALL (base : GUIEnvBasePtr) CloseGUIWindow *
  497.           (window[8] : I.WindowPtr);                -54;
  498.  
  499.   LIBCALL (base : GUIEnvBasePtr) CloseGUIScreen *
  500.           (screen[8] : I.ScreenPtr);                -60;
  501.  
  502.   LIBCALL (base : GUIEnvBasePtr) CreateGUIInfoA *
  503.           (window[8] : I.WindowPtr;
  504.            tags[9] : ARRAY OF U.TagItem) : GUIInfoPtr;  -66;
  505.  
  506.   LIBCALL (base : GUIEnvBasePtr) CreateGUIInfo *
  507.           (window[8] : I.WindowPtr;
  508.            tags[9].. : U.Tag) : GUIInfoPtr;  -66;
  509.  
  510.   LIBCALL (base : GUIEnvBasePtr) FreeGUIInfo *
  511.           (gui[8] : GUIInfoPtr);                -72;
  512.  
  513.   LIBCALL (base : GUIEnvBasePtr) DrawGUIA *
  514.           (gui[8] : GUIInfoPtr;
  515.            tags[9]: ARRAY OF U.TagItem) : INTEGER;        -78;
  516.  
  517.   LIBCALL (base : GUIEnvBasePtr) DrawGUI *
  518.           (gui[8] : GUIInfoPtr;
  519.            tags[9]..: U.Tag) : INTEGER;        -78;
  520.  
  521.   LIBCALL (base : GUIEnvBasePtr) ChangeGUIA *
  522.           (gui[8]  : GUIInfoPtr;
  523.            tags[9] : ARRAY OF U.TagItem) : INTEGER;       -84;
  524.  
  525.   LIBCALL (base : GUIEnvBasePtr) ChangeGUI *
  526.           (gui[8]  : GUIInfoPtr;
  527.            tags[9].. : U.Tag) : INTEGER;       -84;
  528.  
  529.   LIBCALL (base : GUIEnvBasePtr) CreateGUIGadgetA *
  530.           (gui[8] : GUIInfoPtr;
  531.            left[0] : INTEGER;
  532.            top[1]  : INTEGER;
  533.            width[2]  : INTEGER;
  534.            height[3] : INTEGER;
  535.            kind[4] : LONGINT;
  536.            tags[9] : ARRAY OF U.TagItem);                 -90;
  537.  
  538.   LIBCALL (base : GUIEnvBasePtr) CreateGUIGadget *
  539.           (gui[8] : GUIInfoPtr;
  540.            left[0] : INTEGER;
  541.            top[1]  : INTEGER;
  542.            width[2]  : INTEGER;
  543.            height[3] : INTEGER;
  544.            kind[4] : LONGINT;
  545.            tags[9].. : U.Tag);                 -90;
  546.  
  547.   LIBCALL (base : GUIEnvBasePtr) CreateGUIMenuEntryA *
  548.           (gui[8]  : GUIInfoPtr;
  549.            type[0] : SHORTINT;
  550.            text[9] : E.STRPTR;
  551.            tags[10] : ARRAY OF U.TagItem);              -96;
  552.  
  553.   LIBCALL (base : GUIEnvBasePtr) CreateGUIMenuEntry *
  554.           (gui[8]  : GUIInfoPtr;
  555.            type[0] : SHORTINT;
  556.            text[9] : E.STRPTR;
  557.            tags[10].. : U.Tag);              -96;
  558.  
  559.   LIBCALL (base : GUIEnvBasePtr) WaitGUIMsg *
  560.           (gui[8] : GUIInfoPtr);                -102;
  561.  
  562.   LIBCALL (base : GUIEnvBasePtr) GetGUIMsg *
  563.           (gui[8] : GUIInfoPtr) : BOOLEAN;      -108;
  564.  
  565.  
  566.   LIBCALL (base : GUIEnvBasePtr) SetGUIGadgetA *
  567.           (gui[8] : GUIInfoPtr;
  568.            nbr[0] : INTEGER;
  569.            tags[9]: ARRAY OF U.TagItem);                  -114;
  570.  
  571.   LIBCALL (base : GUIEnvBasePtr) SetGUIGadget *
  572.           (gui[8] : GUIInfoPtr;
  573.            nbr[0] : INTEGER;
  574.            tags[9]..: U.Tag);                  -114;
  575.  
  576.   LIBCALL (base : GUIEnvBasePtr) GetGUIGadget *
  577.           (gui[8] : GUIInfoPtr;
  578.            nbr[0] : INTEGER;
  579.            attr[1]: LONGINT) : LONGINT;           -120;
  580.  
  581.   LIBCALL (base : GUIEnvBasePtr) GUIGadgetActionA *
  582.           (gui[8] : GUIInfoPtr;
  583.            tags[9]: ARRAY OF U.TagItem);                  -126;
  584.  
  585.   LIBCALL (base : GUIEnvBasePtr) GUIGadgetAction *
  586.           (gui[8] : GUIInfoPtr;
  587.            tags[9]..: U.Tag);                  -126;
  588.  
  589.   LIBCALL (base : GUIEnvBasePtr) GUIRequestA *
  590.           (gui[8] : GUIInfoPtr;
  591.            text[9] : E.STRPTR;
  592.            kind[0] : LONGINT;
  593.            tags[10] : ARRAY OF U.TagItem) : LONGINT;    -132;
  594.  
  595.   LIBCALL (base : GUIEnvBasePtr) GUIRequest *
  596.           (gui[8] : GUIInfoPtr;
  597.            text[9] : E.STRPTR;
  598.            kind[0] : LONGINT;
  599.            tags[10].. : U.Tag) : LONGINT;    -132;
  600.  
  601.   LIBCALL (base : GUIEnvBasePtr) ShowGuideNodeA *
  602.           (gui[8]   : GUIInfoPtr;
  603.            guide[9] : E.STRPTR;
  604.            node[10] : E.STRPTR;
  605.            tags[11] : ARRAY OF U.TagItem) : INTEGER; -138;
  606.  
  607.   LIBCALL (base : GUIEnvBasePtr) ShowGuideNode *
  608.           (gui[8]   : GUIInfoPtr;
  609.            guide[9] : E.STRPTR;
  610.            node[10] : E.STRPTR;
  611.            tags[11].. : U.Tag) : INTEGER; -138;
  612.  
  613.   LIBCALL (base : GUIEnvBasePtr) GetCatStr *
  614.           (gui[8] : GUIInfoPtr;
  615.            str[0] : LONGINT;
  616.            def[9] : E.STRPTR) : E.STRPTR; -144;
  617.  
  618.   LIBCALL (base : GUIEnvBasePtr) GetLocStr *
  619.           (gui[8] : GUIInfoPtr;
  620.            str[0] : LONGINT;
  621.            def[9] : E.STRPTR) : E.STRPTR; -150;
  622.  
  623.  
  624.  
  625. (* $L- Address globals through A4 *)
  626.  
  627. PROCEDURE* CloseLib (VAR rc : LONGINT);
  628. BEGIN
  629.   IF base # NIL THEN E.base.CloseLibrary (base) END;
  630. END CloseLib;
  631.  
  632. PROCEDURE OpenLib * (mustOpen : BOOLEAN);
  633. BEGIN
  634.   IF base = NIL THEN
  635.     base := E.base.OpenLibrary (Name, Version);
  636.     IF base # NIL THEN K.SetCleanup(CloseLib)
  637.     ELSIF mustOpen THEN HALT (100)
  638.     END
  639.   END
  640. END OpenLib;
  641.  
  642.  
  643. BEGIN (* GUIEnv *)
  644.   base := NIL;
  645. END GUIEnv.
  646.